package com.ruoyi.project.wenyanwen.sqlitestyle.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.wenyanwen.sqlitestyle.domain.SqliteStyle;
import com.ruoyi.project.wenyanwen.sqlitestyle.mapper.SqliteStyleMapper;
import com.ruoyi.project.wenyanwen.sqlitestyle.service.ISqliteStyleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Sqlite样式Service业务层处理
 *
 * @author shixiangwen
 * @date 2021-03-15
 */
@Service
@DataSource(DataSourceType.KKWENYANWEN)
public class SqliteStyleServiceImpl implements ISqliteStyleService {

    @Autowired
    private SqliteStyleMapper sqliteStyleMapper;

    /**
     * 查询Sqlite样式
     *
     * @param id Sqlite样式ID
     * @return Sqlite样式
     */
    @Override
    public SqliteStyle selectSqliteStyleById(Long id) {
        return sqliteStyleMapper.selectSqliteStyleById(id);
    }

    /**
     * 查询Sqlite样式列表
     *
     * @param sqliteStyle Sqlite样式
     * @return Sqlite样式
     */
    @Override
    public List<SqliteStyle> selectSqliteStyleList(SqliteStyle sqliteStyle) {
        return sqliteStyleMapper.selectSqliteStyleList(sqliteStyle);
    }

    /**
     * 新增Sqlite样式
     *
     * @param sqliteStyle Sqlite样式
     * @return 结果
     */
    @Override
    public int insertSqliteStyle(SqliteStyle sqliteStyle) {
        return sqliteStyleMapper.insertSqliteStyle(sqliteStyle);
    }

    /**
     * 修改Sqlite样式
     *
     * @param sqliteStyle Sqlite样式
     * @return 结果
     */
    @Override
    public int updateSqliteStyle(SqliteStyle sqliteStyle) {
        return sqliteStyleMapper.updateSqliteStyle(sqliteStyle);
    }

    /**
     * 删除Sqlite样式对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSqliteStyleByIds(String ids) {
        return sqliteStyleMapper.deleteSqliteStyleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除Sqlite样式信息
     *
     * @param id Sqlite样式ID
     * @return 结果
     */
    @Override
    public int deleteSqliteStyleById(Long id) {
        return sqliteStyleMapper.deleteSqliteStyleById(id);
    }
}
